<template>
  <!-- //地层描述 -->

  <div>
    <Collapse
      :description-column="3"
      :field-list="drillRoundtripDescritionFieldList"
      :field-longlist="FieldListLong"
      :data="data"
    />
  </div>
</template>

<script setup lang="ts">
import _ from "lodash";
import Collapse from "@/components/common/collapse/Collapse.vue";
import API from "@/network/api";
import { useRvo } from "@/hook/useRvo";

const drillRoundtripDescritionFieldList = reactive([
  {
    name: "type",
    label: "地层类型",
    type: "TEXT",
  },
  {
    name: "code",
    label: "地层编号",
    type: "TEXT",
  },

  {
    name: "topDepth",
    label: "顶深",
    type: "TEXTMI",
  },
  {
    name: "bottomDepth",
    label: "底深",
    type: "TEXTMI",
  },
  {
    name: "stratumChange",
    label: "是否变层",
    type: "TEXT",
  },

  {
    name: "none",
    label: "层厚(m)",
    type: "REDUCE",
    paramOne: "bottomDepth",
    paramTwo: "topDepth",
  },
  {
    name: "color",
    label: "颜色",
    type: "TEXTJUDGE",
    condition: "岩层",
    relation: "type",
  },
  {
    name: "color",
    label: "颜色",
    type: "TEXTJUDGE",
    condition: "土层",
    relation: "type",
  },
  {
    name: "completeness",
    label: "完整程度",
    type: "TEXTJUDGE",
    condition: "岩层",
    relation: "type",
  },
  {
    name: "weathering",
    label: "风化程度",
    type: "TEXTJUDGE",
    condition: "岩层",
    relation: "type",
  },
  {
    name: "hardness",
    label: "坚硬程度",
    type: "TEXTJUDGE",
    condition: "岩层",
    relation: "type",
  },
  {
    name: "rockRqd",
    label: "岩体RQD(%)",
    type: "TEXTJUDGE",
    condition: "岩层",
    relation: "type",
  },
  {
    name: "drillCoreLength",
    label: "岩芯长度(m)",
    type: "TEXTJUDGE",
    condition: "岩层",
    relation: "type",
  },
  {
    name: "recoveryRatio",
    label: "岩芯采取率(%)",
    type: "TEXTJUDGE",
    condition: "岩层",
    relation: "type",
  },
  {
    name: "state",
    label: "状态",
    type: "TEXTJUDGE",
    condition: "土层",
    relation: "type",
  },
  {
    name: "humidity",
    label: "湿度",
    type: "TEXTJUDGE",
    condition: "土层",
    relation: "type",
  },
  // {
  //     name: "humidity",
  //     label: "湿度",
  //     type: "TEXTJUDGE",
  //         condition:'岩层',
  //         relation:'type'
  // },
  {
    name: "name",
    label: "地层名称",
    type: "LONGTEXT",
  },

  {
    name: "description",
    label: "描述",
    type: "LONGTEXT",
  },
  {
    name: "image",
    label: "地层图片",
    type: "LONGIMAGE",
  },
]);
const FieldListLong = reactive([{}]);
const data = ref([]);

const props = defineProps({
  drillHoleId: {
    type: String,
    default: "",
  },
});

onMounted(async () => {
  let listVo = useRvo().listRvo;
  listVo.id = props.drillHoleId;
  listVo.pageSize = 100;
  let res = await API.drillStratum.list(listVo);
  data.value = res.data.list;
  //区分长文本
});
</script>

<style scoped lang="scss"></style>
